//
//  WSDSGFirstTableViewCell.swift
//  AnimationTableView
//
//  Created by 刘爽 on 16/11/4.
//  Copyright © 2016年 WSDSG. All rights reserved.
//

import UIKit

class WSDSGFirstTableViewCell: UITableViewCell {
    
    let gradientLayer = CAGradientLayer()
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        gradientLayer.frame = self.bounds
        let color1 = UIColor(white: 1.0, alpha: 0.2).CGColor as CGColorRef
        let color2 = UIColor(white: 1.0, alpha: 0.1).CGColor as CGColorRef
        let color3 = UIColor.clearColor().CGColor as CGColorRef
        let color4 = UIColor(white: 0.0, alpha: 0.05).CGColor as CGColorRef
        gradientLayer.colors = [color1,color2,color3,color4]
        gradientLayer.locations = [0.01,0.1,0.8,0.95]
        layer .addSublayer(gradientLayer)
        
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init with Decoder is not implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        self.gradientLayer.frame = self.bounds
    }
}
